import {
  request
} from './wxRequest_test';
import {urlBase} from "./api";
// export let urlBase_test = 'http://www.scyphr.com/api';
// export let urlBase_test1 = 'http://192.168.0.110:8769/v1';
// export let urlBase_test1 = 'http://192.168.0.33:8769/v1';
// export let urlBase_test1 = 'http://120.26.123.95:8769/v1';
export let urlBase_test1 = 'https://wechat.scyphr.com/v1';
// export let urlBase_test1 = 'https://lamp.meishifulu.cn/app/v1';
let token = uni.getStorageSync("testCathe");
let deviceId = function(){
    return uni.getStorageSync("USER_INFO").signature;
}
let access_token = function(){
 return uni.getStorageSync("access_token")?uni.getStorageSync("access_token"):"1234";
};
// let b = new Base64();
let Authorization = "Basic "+"YmV5b25kMjpzZWNyZXQy";
// let Authorization = "Basic "+wx.arrayBufferToBase64("beyond2:secret2");

let commonH={
    'Authorization':'Bearer '+access_token()
}

export const _deviceQuery = function (params,fun,header) {request(urlBase_test1+'/fourmood-web/forecast/sex/query?access_token='+access_token(),params,fun,header,'GET')};//虫情设备列表
export const _lampDetail = function (params,fun,header) {request(urlBase_test1+'/fourmood-web/forecast/sex/current?access_token='+access_token(),params,fun,header,'GET')};//历史数据
export const _lampHour = function (params,fun,header) {request(urlBase_test1+'/fourmood-web/forecast/sex/hourStat?access_token='+access_token(),params,fun,header,'GET')};//当日时报
export const _lampStatistics = function (params,fun,header) {request(urlBase_test1+'/fourmood-web/forecast/sex/statistics?access_token='+access_token(),params,fun,header,'GET')};//报表
export const _lampInstallDetail = function (params,fun,header) {request(urlBase_test1+'/fourmood-web/forecast/sex/installInfo?access_token='+access_token(),params,fun,header,'GET')};//安装详情 电子性诱测报仪
export const _lampInstallDetail2 = function (params,fun,header) {request(urlBase_test1+'/fourmood-web/install/getInstall?access_token='+access_token(),params,fun,header,'GET')};//安装详情2 测报系列 墒情 苗情 气象
export const _lampList = function (params,fun,header) {request(urlBase_test1+'/fourmood-web/forecast/sex/gps?access_token='+access_token(),params,fun,header,'GET')};//列表
export const _lampSendMsg = function (params,fun,header) {request(urlBase_test1+'/fourmood-web/forecast/sex/ctl?access_token='+access_token(),params,fun,header,'POST')};//远程灯反控
















